home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 10 / 010.d81 / life expectancy (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  5KB  |  198 lines

  1. 1 gosub60000
  2. 5 rem **** life expectancy quiz
  3. 6 :
  4. 10 rem *** copyright 1983
  5. 20 rem *** by john orban
  6. 21 rem *** translated for the commodore
  7. 22 rem *** by donna k. woody
  8. 23 :
  9. 24 poke53280,3:poke53281,0:print"[158]":poke53272,23:printchr$(8)
  10. 25 v$=""
  11. 26 :
  12. 30 print"[147]"tab(18)"[204][201][198][197]"
  13. 40 print""tab(15)"[197][216][208][197][195][212][193][206][195][217]"
  14. 50 print""tab(18)"[209][213][201][218]"
  15. 60 print"":fori=1to19:print"]";:next
  16. 70 fori=20to40:print"[";:next
  17. 90 print"  [193]n [193]nalysis -- [204]ongevity vs [204]ifestyle"
  18. 100 print"      [200]ow long will ** you ** live?"
  19. 120 print"[208]ress <[211][208][193][195][197] [194][193][210]> to begin program....";
  20. 130 geta$:ifa$=""then130
  21. 140 goto210
  22. 150 geta$:ifa$=""then150
  23. 160 ifa$<>"n"anda$<>"[206]"anda$<>"y"anda$<>"[217]"goto150
  24. 170 return
  25. 180 print"[147]             [204][201][198][197] [197][216][208][197][195][212][193][206][195][217]"
  26. 190 print""tab(19);a
  27. 200 return
  28. 210 print"[147]":a=72:gosub180
  29. 220 printv$"[193]re you male (m) or female (f)?"
  30. 230 getb$:ifb$=""then230
  31. 240 ifb$<>"m"andb$<>"[205]"andb$<>"f"andb$<>"[198]"then230
  32. 250 ifb$="m"orb$="[205]"thena=a-3:goto270
  33. 260 a=a+4
  34. 270 gosub180
  35. 280 printv$"[196]o you live in a city of over 2 million population (y/n)?"
  36. 290 gosub150
  37. 300 ifa$="y"ora$="[217]"thena=a-2
  38. 310 gosub180
  39. 320 printv$"[196]o you live in a town under 10,000 pop- ulation or on a farm (y/n)?"
  40. 330 gosub150
  41. 340 ifa$="[217]"ora$="y"thena=a+2
  42. 350 gosub180
  43. 360 printv$"[196]o you work behind a desk (y/n)?"
  44. 370 gosub150
  45. 380 ifa$="y"ora$="[217]"thena=a-3
  46. 390 gosub180
  47. 400 printv$"[196]oes your work require regular, heavy   physical labor (y/n)?"
  48. 410 gosub150
  49. 420 ifa$="y"ora$="[217]"thena=a+3
  50. 430 gosub180
  51. 440 printv$"[196]o you exercise strenuously (tennis,"
  52. 445 print"running, swimming, etc.) 5 times a week for at least 1/2 hour (y/n)?"
  53. 450 gosub150
  54. 460 ifa$="y"ora$="[217]"thena=a+2
  55. 470 gosub180
  56. 480 printv$"[196]o you live with a spouse or friend     (y/n)?"
  57. 490 gosub150
  58. 500 ifa$="y"ora$="[217]"thena=a+5:goto560
  59. 510 print"[145][145][200]ow many years have you lived alone     since age 25?"
  60. 512 print"(1) 1-10 years      (2) 11-20 years     (3) 21+ years";
  61. 520 getb$:ifb$=""then520
  62. 525 ifval(b$)<1orval(b$)>3then520
  63. 530 b=val(b$)
  64. 540 a=a-b
  65. 550 goto560
  66. 560 gosub180
  67. 570 printv$"[196]o you sleep more than 10 hours each    night (y/n)?"
  68. 580 gosub150
  69. 590 ifa$="y"ora$="[217]"thena=a-4
  70. 600 gosub180
  71. 610 printv$"[193]re you intense, agressive, easily      angered (y/n)?"
  72. 620 gosub150
  73. 630 ifa$="y"ora$="[217]"thena=a-3
  74. 640 gosub180
  75. 650 printv$"[193]re you usually easy-going and relaxed  (y/n)?"
  76. 660 gosub150
  77. 670 ifa$="y"ora$="[217]"thena=a+3
  78. 680 gosub180
  79. 690 printv$"[193]re you h[146]appy or u[146]nhappy (h/u)?"
  80. 700 geta$:ifa$=""then700
  81. 710 ifa$<>"h"anda$<>"[200]"anda$<>"u"anda$<>"[213]"thengoto700
  82. 720 ifa$="h"ora$="[200]"thena=a+1:goto740
  83. 730 a=a-2
  84. 740 gosub180
  85. 750 printv$"[200]ave you had a speeding ticket in the   last year (y/n)?"
  86. 760 gosub150
  87. 770 ifa$="y"ora$="[217]"thena=a-1
  88. 780 gosub180
  89. 790 printv$"[196]o you earn over $50,000 per year (y/n)?"
  90. 800 gosub150
  91. 810 ifa$="y"ora$="[217]"thena=a-2
  92. 820 gosub180
  93. 830 printv$"[193]re you a college graduate (y/n)?"
  94. 840 gosub150
  95. 850 ifa$="y"ora$="[217]"thena=a+1
  96. 860 gosub180
  97. 870 printv$"[196]o you have a graduate or professional  degree (y/n)?"
  98. 880 gosub150
  99. 890 ifa$="y"ora$="[217]"thena=a+2
  100. 900 gosub180
  101. 910 printv$"[193]re you over 65 and still working (y/n)?"
  102. 920 gosub150
  103. 930 ifa$="y"ora$="[217]"thena=a+3
  104. 940 gosub180
  105. 950 printv$"[196]id any of your grandparents live to    age 85 (y/n)?"
  106. 960 gosub150
  107. 970 ifa$="y"ora$="[217]"thena=a+2
  108. 980 gosub180
  109. 990 printv$"[196]id either of your parents die of a"
  110. 995 print"stroke or heart attack before age 50    (y/n)?"
  111. 1000 gosub150
  112. 1010 ifa$="y"ora$="[217]"thena=a-4
  113. 1020 gosub180
  114. 1030 printv$"[196]oes/did any parent, brother/sister"
  115. 1032 print"under 50 have/had cancer, heart condi-"
  116. 1034 print"tion or has/had diabetes since child-   hood (y/n)?"
  117. 1040 gosub150
  118. 1050 ifa$="y"ora$="[217]"thena=a-3
  119. 1060 gosub180
  120. 1070 printleft$(v$,7)"[200]ow many packs of cigarettes per day to do you smoke?"
  121. 1080 print"(0) ===> [206]one":print"(1) ==> 1/2 - 1":print"(2) ==> 1 - 2"
  122. 1090 print"(3) ==> [205]ore than 2"
  123. 1100 getb$:ifb$=""then1100
  124. 1102 ifb$<>"0"andb$<>"1"andb$<>"2"andb$<>"3"then1100
  125. 1110 b=val(b$)
  126. 1120 ifb=0thengoto1150
  127. 1130 ifb=3thena=a-8:goto1150
  128. 1140 a=a-(b*3)
  129. 1150 gosub180
  130. 1160 printv$"[196]o you drink the equivalant of a quart  bottle of liquor a day (y/n)?"
  131. 1170 gosub150
  132. 1190 gosub180
  133. 1200 printv$"[193]re you overweight (y/n)?"
  134. 1210 gosub150
  135. 1220 ifa$="n"ora$="[206]"thengoto1300
  136. 1230 print"[145][145][145][194]y how much?             "
  137. 1232 print"(1) ==> 50+ lbs          ":print"(2) ==> 30-50 lbs"
  138. 1234 :print"(3) ==> 30 lbs or less"
  139. 1250 getb$:ifb$=""then1250
  140. 1252 ifval(b$)<1orval(b$)>3then1250
  141. 1260 b=val(b$)
  142. 1270 ifb=1thena=a-8:goto1300
  143. 1280 ifb=2thena=a-4:goto1300
  144. 1290 a=a-2
  145. 1300 gosub180
  146. 1310 printv$"[193]re you over 40 and do you have a yearlycheckup (y/n)?"
  147. 1320 gosub150
  148. 1330 ifa$="[217]"ora$="y"thena=a+2
  149. 1340 gosub180
  150. 1350 fori=1to1000:next
  151. 1360 print"[147]"
  152. 1370 printtab(15)"[193]ge [193]djustment"
  153. 1380 printtab(7)"[201]f you are:"tab(30)"[208]ress:"
  154. 1390 print"     [194]etween 30 and 40"tab(32)"1"
  155. 1400 print"     [194]etween 40 and 50"tab(32)"2"
  156. 1410 print"     [194]etween 50 and 70"tab(32)"3"
  157. 1420 print"     [207]ver 70"tab(32)"4"
  158. 1430 print"     [206]one of the above"tab(32)"5"
  159. 1440 getb$:ifb$=""then1440
  160. 1442 ifval(b$)<1orval(b$)>5then1440
  161. 1450 b=val(b$)
  162. 1460 ifb<>5thena=a+b+1
  163. 1470 gosub180
  164. 1480 print""
  165. 1490 print"     [217]our life expectancy is ";a"[146]"
  166. 1510 print"[200]ow well have you done?  [212]he following"
  167. 1520 print"chart tells what percent of the pop-"
  168. 1522 print"ulation you will outlive if you make it"
  169. 1524 print"to your life expectancy."
  170. 1530 print"[193]ge   60  65  70  75  80  85  90  95"
  171. 1540 print"[205]en   26% 36% 48% 61% 75% 87% 96% 99%"
  172. 1550 print"[215]omen 15% 20% 30% 39% 53% 70% 88% 97%"
  173. 1555 print"     [208]ress <[211][208][193][195][197] [194][193][210]> to continue";
  174. 1557 getk$:ifk$=""then1557
  175. 1560 print"[147][206]ow try it again and see what happens"
  176. 1562 print"if you change just a few of your life-  style habits."
  177. 1570 print"[196]o you want to run the program again    (y/n)?"
  178. 1580 getk$:ifk$=""then1580
  179. 1590 ifk$="y"ork$="[217]"thengoto5
  180. 1600 ifk$="n"ork$="[206]"then63000
  181. 1610 goto1580
  182. 1700 :
  183. 60000 t$="                      ":c=0:c$="":print"[147]":poke53281,0
  184. 60030 printspc(9)""t$:printspc(9)" [204]ife [197]xpectancy [209]uiz [146]"
  185. 60051 printspc(9)""t$:print:printtab(18)"by"
  186. 60060 print:printspc(14)"[202]ohn [207]rban"
  187. 60070 print:printspc(12)"[195]opyright 1985"
  188. 60080 print:print:print:print"     [204][207][193][196][211][212][193][210] is not public domain."
  189. 60090 print:print"  [208]lease respect the author's rights."
  190. 60100 print:print"      [208]ress space bar to continue."
  191. 60110 forcc=1to48:getk$:ifk$=" "then60130
  192. 60120 ifcc=1thenprintmid$(c$,c+2,1)"[145][145]";:c=not(c)
  193. 60125 next:goto60100
  194. 60130 printc$:return
  195. 63000 rem    connect back to l.s.
  196. 63002 print"[147]load"chr$(34)"payload"chr$(34)",8":print"run"
  197. 63004 poke198,0:poke631,13:poke632,13:poke198,2:end
  198.